package io.cucumber.core.runner;

import com.zws.cucumber.snapshot.ZwsSnapshotFacade;

import java.util.Collections;
import java.util.UUID;
import java.util.function.Supplier;

public class CoreRunnerSnapshotTestStepHelper {

    public static PickleStepTestStep newSnapshotTakePickleStepTestStep(Supplier<ZwsSnapshotFacade> snapshotFacadeSupplier, String snapshotName) {
        return new PickleStepTestStep(
                UUID.randomUUID(),
                null,
                new NoStep("[OPTIMIZATION STEP] take snapshot"),
                Collections.emptyList(),
                Collections.emptyList(),
                new SnapshotTakeStepDefinitionMatch(snapshotFacadeSupplier, snapshotName));
    }

    public static PickleStepTestStep newSnapshotRestorePickleStepTestStep(Supplier<ZwsSnapshotFacade> snapshotFacadeSupplier, String snapshotName, String skipStepsText) {
        return new PickleStepTestStep(
                UUID.randomUUID(),
                null,
                new NoStep("[OPTIMIZATION STEP] restore snapshot"),
                Collections.emptyList(),
                Collections.emptyList(),
                new SnapshotRestoreStepDefinitionMatch(snapshotFacadeSupplier, snapshotName, skipStepsText));
    }

    public static PickleStepTestStep newSnapshotDeletePickleStepTestStep(Supplier<ZwsSnapshotFacade> snapshotFacadeSupplier, String snapshotName) {
        return new PickleStepTestStep(
                UUID.randomUUID(),
                null,
                new NoStep("[OPTIMIZATION STEP] delete snapshot"),
                Collections.emptyList(),
                Collections.emptyList(),
                new SnapshotDeleteStepDefinitionMatch(snapshotFacadeSupplier, snapshotName));
    }
}
